package com.easy.query.solon.web.conversion;

import com.easy.query.core.basic.extension.conversion.ValueConverter;
import com.easy.query.core.util.EasyStringUtil;

/**
 * create time 2023/8/13 22:48
 * 文件说明
 *
 * @author xuejiaming
 */
public class AddressMask implements ValueConverter<String,String> {
    @Override
    public String serialize(String s) {
        //因为是VO对象不需要实现
        throw new UnsupportedOperationException();
    }

    @Override
    public String deserialize(Class<String> propertyClass, String value) {
        if(EasyStringUtil.isBlank(value)){
            return value;
        }
        if(value.length()>5){
            return value.substring(0,3)+"***";
        }
        return value;
    }
}
